<h1>Galerije</h1>

<table cellspacing="0" class="list">
	<tr>
		<th>Id</th>
		<th>Ime</th>
		<th width="60" style="text-align:center">Broj slika</th>
		<th width="100" style="text-align:center">Naslovna slika</th>
		<th class="actions"><a href="#gallery/edit/" onclick="adminContent('{#root#}/admin_gallery/edit')">nova galerija</a></th>
	</tr>
	{if $galleries|@count}
		{foreach from=$galleries item=gallery key=k name=gallerylist}
		<tr class="{if $smarty.foreach.gallerylist.index%2}even{else}odd{/if}">
			<td>{$gallery.id}</td>
			<td>
				<a href="#gallery/edit/{$gallery.id}" onclick="adminContent('{#root#}/admin_gallery/edit/{$gallery.id}')">
					{$gallery.title}
				</a>
			</td>
			<td align="center">{$gallery.count}</td>
			<td align="center">
				{if $gallery.cover}
				<img src="{#root#}/userfiles/gallery/{$gallery.id}/thumb/{$gallery.cover.src}" alt="" />
				{else}
					-
				{/if}
			</td>
			<td class="actions">
				<a href="#gallery/edit/{$gallery.id}" onclick="adminContent('{#root#}/admin_gallery/edit/{$gallery.id}')">izmeni</a>
				<a href="javascript:void(0)" onclick="if(confirm('Da li želite da obrišete galeriju?'))adminContent('{#root#}/admin_gallery/delete/{$gallery.id}')">obriši</a>
			</td>
		</tr>
		{/foreach}
	{else}
		<tr>
			<td colspan="3">Nema galerija.</td>
		</tr>
	{/if}
</table>